<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-2"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- Module      :  Distribution.InstalledPackageInfo</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2004</span><span>
</span><span id="line-5"></span><span class="hs-comment">--</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- This is the information about an /installed/ package that</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- is communicated to the @ghc-pkg@ program in order to register</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- a package.  @ghc-pkg@ now consumes this package format (as of version</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- 6.4). This is specific to GHC at the moment.</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- The @.cabal@ file format is for describing a package that is not yet</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- installed. It has a lot of flexibility, like conditionals and dependency</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- ranges. As such, that format is not at all suitable for describing a package</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- that has already been built and installed. By the time we get to that stage,</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- we have resolved all conditionals and resolved dependency version</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- constraints to exact versions of dependent packages. So, this module defines</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- the 'InstalledPackageInfo' data structure that contains all the info we keep</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- about an installed package. There is a parser and pretty printer. The</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- textual format is rather simpler than the @.cabal@ format: there are no</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- sections, for example.</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-comment">-- This module is meant to be local-only to Distribution...</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.InstalledPackageInfo</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier">InstalledPackageInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#installedComponentId"><span class="hs-identifier">installedComponentId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#installedOpenUnitId"><span class="hs-identifier">installedOpenUnitId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#sourceComponentName"><span class="hs-identifier">sourceComponentName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#requiredSignatures"><span class="hs-identifier">requiredSignatures</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="Distribution.Types.ExposedModule.html#ExposedModule"><span class="hs-identifier">ExposedModule</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="Distribution.Types.AbiDependency.html#AbiDependency"><span class="hs-identifier">AbiDependency</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#emptyInstalledPackageInfo"><span class="hs-identifier">emptyInstalledPackageInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#parseInstalledPackageInfo"><span class="hs-identifier">parseInstalledPackageInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#showInstalledPackageInfo"><span class="hs-identifier">showInstalledPackageInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#showFullInstalledPackageInfo"><span class="hs-identifier">showFullInstalledPackageInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#showInstalledPackageInfoField"><span class="hs-identifier">showInstalledPackageInfoField</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#showSimpleInstalledPackageInfoField"><span class="hs-identifier">showSimpleInstalledPackageInfoField</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Backpack.html"><span class="hs-identifier">Distribution.Backpack</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.CabalSpecVersion.html"><span class="hs-identifier">Distribution.CabalSpecVersion</span></a></span><span>         </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.CabalSpecVersion.html#cabalSpecLatest"><span class="hs-identifier">cabalSpecLatest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.html"><span class="hs-identifier">Distribution.FieldGrammar</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.FieldGrammar.FieldDescrs.html"><span class="hs-identifier">Distribution.FieldGrammar.FieldDescrs</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.ModuleName.html"><span class="hs-identifier">Distribution.ModuleName</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Package.html"><span class="hs-identifier">Distribution.Package</span></a></span><span>                  </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Package.html#installedUnitId"><span class="hs-identifier">installedUnitId</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentName.html"><span class="hs-identifier">Distribution.Types.ComponentName</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Utils.Generic.html"><span class="hs-identifier">Distribution.Utils.Generic</span></a></span><span>            </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.Generic.html#toUTF8BS"><span class="hs-identifier">toUTF8BS</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.html#"><span class="hs-identifier">Data.Map</span></a></span><span>            </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Distribution.Fields.html"><span class="hs-identifier">Distribution.Fields</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">P</span></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../pretty/src/Text.PrettyPrint.html#"><span class="hs-identifier">Text.PrettyPrint</span></a></span><span>    </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Disp</span></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html"><span class="hs-identifier">Distribution.Types.InstalledPackageInfo</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.FieldGrammar.html"><span class="hs-identifier">Distribution.Types.InstalledPackageInfo.FieldGrammar</span></a></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-comment">-- $setup</span><span>
</span><span id="line-65"></span><span class="hs-comment">-- &gt;&gt;&gt; :set -XOverloadedStrings</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#installedComponentId"><span class="hs-identifier hs-type">installedComponentId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier hs-type">InstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentId.html#ComponentId"><span class="hs-identifier hs-type">ComponentId</span></a></span><span>
</span><span id="line-68"></span><span id="installedComponentId"><span class="annot"><span class="annottext">installedComponentId :: InstalledPackageInfo -&gt; ComponentId
</span><a href="Distribution.InstalledPackageInfo.html#installedComponentId"><span class="hs-identifier hs-var hs-var">installedComponentId</span></a></span></span><span> </span><span id="local-6989586621679705657"><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705657"><span class="hs-identifier hs-var">ipi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-69"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ComponentId -&gt; String
</span><a href="Distribution.Types.ComponentId.html#unComponentId"><span class="hs-identifier hs-var">unComponentId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; ComponentId
</span><a href="Distribution.Types.InstalledPackageInfo.html#installedComponentId_"><span class="hs-identifier hs-var hs-var">installedComponentId_</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705657"><span class="hs-identifier hs-var">ipi</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-70"></span><span>        </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; ComponentId
</span><a href="Distribution.Types.ComponentId.html#mkComponentId"><span class="hs-identifier hs-var">mkComponentId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; String
</span><a href="Distribution.Types.UnitId.html#unUnitId"><span class="hs-identifier hs-var">unUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; UnitId
</span><a href="Distribution.Types.InstalledPackageInfo.html#installedUnitId"><span class="hs-identifier hs-var hs-var">installedUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705657"><span class="hs-identifier hs-var">ipi</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-71"></span><span>        </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; ComponentId
</span><a href="Distribution.Types.InstalledPackageInfo.html#installedComponentId_"><span class="hs-identifier hs-var hs-var">installedComponentId_</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705657"><span class="hs-identifier hs-var">ipi</span></a></span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span class="hs-comment">-- | Get the indefinite unit identity representing this package.</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- This IS NOT guaranteed to give you a substitution; for</span><span>
</span><span id="line-75"></span><span class="hs-comment">-- instantiated packages you will get @DefiniteUnitId (installedUnitId ipi)@.</span><span>
</span><span id="line-76"></span><span class="hs-comment">-- For indefinite libraries, however, you will correctly get</span><span>
</span><span id="line-77"></span><span class="hs-comment">-- an @OpenUnitId@ with the appropriate 'OpenModuleSubst'.</span><span>
</span><span id="line-78"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#installedOpenUnitId"><span class="hs-identifier hs-type">installedOpenUnitId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier hs-type">InstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.html#OpenUnitId"><span class="hs-identifier hs-type">OpenUnitId</span></a></span><span>
</span><span id="line-79"></span><span id="installedOpenUnitId"><span class="annot"><span class="annottext">installedOpenUnitId :: InstalledPackageInfo -&gt; OpenUnitId
</span><a href="Distribution.InstalledPackageInfo.html#installedOpenUnitId"><span class="hs-identifier hs-var hs-var">installedOpenUnitId</span></a></span></span><span> </span><span id="local-6989586621679705651"><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705651"><span class="hs-identifier hs-var">ipi</span></a></span></span><span>
</span><span id="line-80"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; ComponentId -&gt; OpenModuleSubst -&gt; OpenUnitId
</span><a href="Distribution.Backpack.html#mkOpenUnitId"><span class="hs-identifier hs-var">mkOpenUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; UnitId
</span><a href="Distribution.Types.InstalledPackageInfo.html#installedUnitId"><span class="hs-identifier hs-var hs-var">installedUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705651"><span class="hs-identifier hs-var">ipi</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; ComponentId
</span><a href="Distribution.InstalledPackageInfo.html#installedComponentId"><span class="hs-identifier hs-var">installedComponentId</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705651"><span class="hs-identifier hs-var">ipi</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(ModuleName, OpenModule)] -&gt; OpenModuleSubst
forall k a. Ord k =&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#fromList"><span class="hs-identifier hs-var">Map.fromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; [(ModuleName, OpenModule)]
</span><a href="Distribution.Types.InstalledPackageInfo.html#instantiatedWith"><span class="hs-identifier hs-var hs-var">instantiatedWith</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705651"><span class="hs-identifier hs-var">ipi</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span class="hs-comment">-- | Returns the set of module names which need to be filled for</span><span>
</span><span id="line-83"></span><span class="hs-comment">-- an indefinite package, or the empty set if the package is definite.</span><span>
</span><span id="line-84"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#requiredSignatures"><span class="hs-identifier hs-type">requiredSignatures</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier hs-type">InstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.Internal.html#Set"><span class="hs-identifier hs-type">Set</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>
</span><span id="line-85"></span><span id="requiredSignatures"><span class="annot"><span class="annottext">requiredSignatures :: InstalledPackageInfo -&gt; Set ModuleName
</span><a href="Distribution.InstalledPackageInfo.html#requiredSignatures"><span class="hs-identifier hs-var hs-var">requiredSignatures</span></a></span></span><span> </span><span id="local-6989586621679705647"><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705647"><span class="hs-identifier hs-var">ipi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OpenModuleSubst -&gt; Set ModuleName
</span><a href="Distribution.Backpack.html#openModuleSubstFreeHoles"><span class="hs-identifier hs-var">openModuleSubstFreeHoles</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(ModuleName, OpenModule)] -&gt; OpenModuleSubst
forall k a. Ord k =&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#fromList"><span class="hs-identifier hs-var">Map.fromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; [(ModuleName, OpenModule)]
</span><a href="Distribution.Types.InstalledPackageInfo.html#instantiatedWith"><span class="hs-identifier hs-var hs-var">instantiatedWith</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705647"><span class="hs-identifier hs-var">ipi</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-88"></span><span class="hs-comment">-- Munging</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#sourceComponentName"><span class="hs-identifier hs-type">sourceComponentName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier hs-type">InstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentName.html#ComponentName"><span class="hs-identifier hs-type">ComponentName</span></a></span><span>
</span><span id="line-91"></span><span id="sourceComponentName"><span class="annot"><span class="annottext">sourceComponentName :: InstalledPackageInfo -&gt; ComponentName
</span><a href="Distribution.InstalledPackageInfo.html#sourceComponentName"><span class="hs-identifier hs-var hs-var">sourceComponentName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LibraryName -&gt; ComponentName
</span><a href="Distribution.Types.ComponentName.html#CLibName"><span class="hs-identifier hs-var">CLibName</span></a></span><span> </span><span class="annot"><span class="annottext">(LibraryName -&gt; ComponentName)
-&gt; (InstalledPackageInfo -&gt; LibraryName)
-&gt; InstalledPackageInfo
-&gt; ComponentName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; LibraryName
</span><a href="Distribution.Types.InstalledPackageInfo.html#sourceLibName"><span class="hs-identifier hs-var hs-var">sourceLibName</span></a></span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-94"></span><span class="hs-comment">-- Parsing</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-comment">-- | Return either errors, or IPI with list of warnings</span><span>
</span><span id="line-97"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#parseInstalledPackageInfo"><span class="hs-identifier hs-type">parseInstalledPackageInfo</span></a></span><span>
</span><span id="line-98"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-99"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier hs-type">InstalledPackageInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span id="parseInstalledPackageInfo"><span class="annot"><span class="annottext">parseInstalledPackageInfo :: ByteString
-&gt; Either (NonEmpty String) ([String], InstalledPackageInfo)
</span><a href="Distribution.InstalledPackageInfo.html#parseInstalledPackageInfo"><span class="hs-identifier hs-var hs-var">parseInstalledPackageInfo</span></a></span></span><span> </span><span id="local-6989586621679705642"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679705642"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Either ParseError [Field Position]
</span><a href="Distribution.Fields.Parser.html#readFields"><span class="hs-identifier hs-var">P.readFields</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679705642"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-101"></span><span>    </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679705640"><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679705640"><span class="hs-identifier hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty String
-&gt; Either (NonEmpty String) ([String], InstalledPackageInfo)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ParseError -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ParseError
</span><a href="#local-6989586621679705640"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; NonEmpty String
forall a. a -&gt; [a] -&gt; NonEmpty a
</span><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-var">:|</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span>    </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679705637"><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679705637"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Field Position] -&gt; (Fields Position, [[Section Position]])
forall ann. [Field ann] -&gt; (Fields ann, [[Section ann]])
</span><a href="Distribution.FieldGrammar.html#partitionFields"><span class="hs-identifier hs-var">partitionFields</span></a></span><span> </span><span class="annot"><span class="annottext">[Field Position]
</span><a href="#local-6989586621679705637"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-103"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679705635"><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679705635"><span class="hs-identifier hs-var">fs'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[[Section Position]]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ParseResult InstalledPackageInfo
-&gt; ([PWarning],
    Either (Maybe Version, NonEmpty PError) InstalledPackageInfo)
forall a.
ParseResult a
-&gt; ([PWarning], Either (Maybe Version, NonEmpty PError) a)
</span><a href="Distribution.Fields.ParseResult.html#runParseResult"><span class="hs-identifier hs-var">P.runParseResult</span></a></span><span> </span><span class="annot"><span class="annottext">(ParseResult InstalledPackageInfo
 -&gt; ([PWarning],
     Either (Maybe Version, NonEmpty PError) InstalledPackageInfo))
-&gt; ParseResult InstalledPackageInfo
-&gt; ([PWarning],
    Either (Maybe Version, NonEmpty PError) InstalledPackageInfo)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; Fields Position
-&gt; ParsecFieldGrammar InstalledPackageInfo InstalledPackageInfo
-&gt; ParseResult InstalledPackageInfo
forall s a.
CabalSpecVersion
-&gt; Fields Position -&gt; ParsecFieldGrammar s a -&gt; ParseResult a
</span><a href="Distribution.FieldGrammar.Parsec.html#parseFieldGrammar"><span class="hs-identifier hs-var">parseFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#cabalSpecLatest"><span class="hs-identifier hs-var">cabalSpecLatest</span></a></span><span> </span><span class="annot"><span class="annottext">Fields Position
</span><a href="#local-6989586621679705635"><span class="hs-identifier hs-var">fs'</span></a></span><span> </span><span class="annot"><span class="annottext">ParsecFieldGrammar InstalledPackageInfo InstalledPackageInfo
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g InstalledPackageInfo),
 Applicative (g Basic), c (Identity AbiHash),
 c (Identity LibraryVisibility), c (Identity PackageName),
 c (Identity UnitId), c (Identity UnqualComponentName),
 c (List FSep (Identity AbiDependency) AbiDependency),
 c (List FSep (Identity UnitId) UnitId),
 c (List FSep (MQuoted ModuleName) ModuleName),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (MQuoted MungedPackageName), c (MQuoted Version),
 c CompatPackageKey, c ExposedModules, c InstWith,
 c SpecLicenseLenient) =&gt;
g InstalledPackageInfo InstalledPackageInfo
</span><a href="Distribution.Types.InstalledPackageInfo.FieldGrammar.html#ipiFieldGrammar"><span class="hs-identifier hs-var">ipiFieldGrammar</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-104"></span><span>            </span><span class="hs-special">(</span><span id="local-6989586621679705631"><span class="annot"><span class="annottext">[PWarning]
</span><a href="#local-6989586621679705631"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679705630"><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705630"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705630"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
-&gt; Either (NonEmpty String) ([String], InstalledPackageInfo)
-&gt; Either (NonEmpty String) ([String], InstalledPackageInfo)
forall a b. NFData a =&gt; a -&gt; b -&gt; b
</span><a href="../../deepseq/src/Control.DeepSeq.html#deepseq"><span class="hs-operator hs-var">`deepseq`</span></a></span><span> </span><span class="annot"><span class="annottext">([String], InstalledPackageInfo)
-&gt; Either (NonEmpty String) ([String], InstalledPackageInfo)
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679705628"><span class="hs-identifier hs-var">ws'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705630"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-105"></span><span>                </span><span id="local-6989586621679705628"><span class="annot"><span class="annottext">ws' :: [String]
</span><a href="#local-6989586621679705628"><span class="hs-identifier hs-var hs-var">ws'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; PWarning -&gt; String
</span><a href="Distribution.Parsec.Warning.html#showPWarning"><span class="hs-identifier hs-var">P.showPWarning</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">PWarning
</span><a href="#local-6989586621679705624"><span class="hs-identifier hs-var">w</span></a></span><span>
</span><span id="line-106"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679705624"><span class="annot"><span class="annottext">w :: PWarning
</span><a href="#local-6989586621679705624"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Parsec.Warning.html#PWarning"><span class="hs-identifier hs-type">P.PWarning</span></a></span><span> </span><span id="local-6989586621679705622"><span class="annot"><span class="annottext">PWarnType
</span><a href="#local-6989586621679705622"><span class="hs-identifier hs-var">wt</span></a></span></span><span> </span><span class="annot"><span class="annottext">Position
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[PWarning]
</span><a href="#local-6989586621679705631"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-107"></span><span>                      </span><span class="hs-comment">-- filter out warnings about experimental features</span><span>
</span><span id="line-108"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="#local-6989586621679705622"><span class="hs-identifier hs-var">wt</span></a></span><span> </span><span class="annot"><span class="annottext">PWarnType -&gt; PWarnType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">PWarnType
</span><a href="Distribution.Parsec.Warning.html#PWTExperimental"><span class="hs-identifier hs-var">P.PWTExperimental</span></a></span><span>
</span><span id="line-109"></span><span>                      </span><span class="hs-special">]</span><span>
</span><span id="line-110"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[PWarning]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span>  </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Version
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679705619"><span class="annot"><span class="annottext">NonEmpty PError
</span><a href="#local-6989586621679705619"><span class="hs-identifier hs-var">errs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NonEmpty String
-&gt; Either (NonEmpty String) ([String], InstalledPackageInfo)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty String
</span><a href="#local-6989586621679705618"><span class="hs-identifier hs-var">errs'</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-111"></span><span>                </span><span id="local-6989586621679705618"><span class="annot"><span class="annottext">errs' :: NonEmpty String
</span><a href="#local-6989586621679705618"><span class="hs-identifier hs-var hs-var">errs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(PError -&gt; String) -&gt; NonEmpty PError -&gt; NonEmpty String
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PError -&gt; String
</span><a href="Distribution.Parsec.Error.html#showPError"><span class="hs-identifier hs-var">P.showPError</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NonEmpty PError
</span><a href="#local-6989586621679705619"><span class="hs-identifier hs-var">errs</span></a></span><span>
</span><span id="line-112"></span><span>
</span><span id="line-113"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-114"></span><span class="hs-comment">-- Pretty-printing</span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="hs-comment">-- | Pretty print 'InstalledPackageInfo'.</span><span>
</span><span id="line-117"></span><span class="hs-comment">--</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- @pkgRoot@ isn't printed, as ghc-pkg prints it manually (as GHC-8.4).</span><span>
</span><span id="line-119"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#showInstalledPackageInfo"><span class="hs-identifier hs-type">showInstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier hs-type">InstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-120"></span><span id="showInstalledPackageInfo"><span class="annot"><span class="annottext">showInstalledPackageInfo :: InstalledPackageInfo -&gt; String
</span><a href="Distribution.InstalledPackageInfo.html#showInstalledPackageInfo"><span class="hs-identifier hs-var hs-var">showInstalledPackageInfo</span></a></span></span><span> </span><span id="local-6989586621679705614"><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705614"><span class="hs-identifier hs-var">ipi</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-121"></span><span>    </span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; String
</span><a href="Distribution.InstalledPackageInfo.html#showFullInstalledPackageInfo"><span class="hs-identifier hs-var">showFullInstalledPackageInfo</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo
</span><a href="#local-6989586621679705614"><span class="hs-identifier hs-var">ipi</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pkgRoot :: Maybe String
</span><a href="Distribution.Types.InstalledPackageInfo.html#pkgRoot"><span class="hs-identifier hs-var">pkgRoot</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-122"></span><span>
</span><span id="line-123"></span><span class="hs-comment">-- | The variant of 'showInstalledPackageInfo' which outputs @pkgroot@ field too.</span><span>
</span><span id="line-124"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#showFullInstalledPackageInfo"><span class="hs-identifier hs-type">showFullInstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier hs-type">InstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-125"></span><span id="showFullInstalledPackageInfo"><span class="annot"><span class="annottext">showFullInstalledPackageInfo :: InstalledPackageInfo -&gt; String
</span><a href="Distribution.InstalledPackageInfo.html#showFullInstalledPackageInfo"><span class="hs-identifier hs-var hs-var">showFullInstalledPackageInfo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(() -&gt; [String]) -&gt; [PrettyField ()] -&gt; String
forall ann. (ann -&gt; [String]) -&gt; [PrettyField ann] -&gt; String
</span><a href="Distribution.Fields.Pretty.html#showFields"><span class="hs-identifier hs-var">P.showFields</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; () -&gt; [String]
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([PrettyField ()] -&gt; String)
-&gt; (InstalledPackageInfo -&gt; [PrettyField ()])
-&gt; InstalledPackageInfo
-&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
-&gt; PrettyFieldGrammar InstalledPackageInfo InstalledPackageInfo
-&gt; InstalledPackageInfo
-&gt; [PrettyField ()]
forall s a.
CabalSpecVersion -&gt; PrettyFieldGrammar s a -&gt; s -&gt; [PrettyField ()]
</span><a href="Distribution.FieldGrammar.Pretty.html#prettyFieldGrammar"><span class="hs-identifier hs-var">prettyFieldGrammar</span></a></span><span> </span><span class="annot"><span class="annottext">CabalSpecVersion
</span><a href="Distribution.CabalSpecVersion.html#cabalSpecLatest"><span class="hs-identifier hs-var">cabalSpecLatest</span></a></span><span> </span><span class="annot"><span class="annottext">PrettyFieldGrammar InstalledPackageInfo InstalledPackageInfo
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g InstalledPackageInfo),
 Applicative (g Basic), c (Identity AbiHash),
 c (Identity LibraryVisibility), c (Identity PackageName),
 c (Identity UnitId), c (Identity UnqualComponentName),
 c (List FSep (Identity AbiDependency) AbiDependency),
 c (List FSep (Identity UnitId) UnitId),
 c (List FSep (MQuoted ModuleName) ModuleName),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (MQuoted MungedPackageName), c (MQuoted Version),
 c CompatPackageKey, c ExposedModules, c InstWith,
 c SpecLicenseLenient) =&gt;
g InstalledPackageInfo InstalledPackageInfo
</span><a href="Distribution.Types.InstalledPackageInfo.FieldGrammar.html#ipiFieldGrammar"><span class="hs-identifier hs-var">ipiFieldGrammar</span></a></span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-128"></span><span class="hs-comment">--</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- &gt;&gt;&gt; let ipi = emptyInstalledPackageInfo { maintainer = &quot;Tester&quot; }</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- &gt;&gt;&gt; fmap ($ ipi) $ showInstalledPackageInfoField &quot;maintainer&quot;</span><span>
</span><span id="line-131"></span><span class="hs-comment">-- Just &quot;maintainer: Tester&quot;</span><span>
</span><span id="line-132"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#showInstalledPackageInfoField"><span class="hs-identifier hs-type">showInstalledPackageInfoField</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier hs-type">InstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-133"></span><span id="showInstalledPackageInfoField"><span class="annot"><span class="annottext">showInstalledPackageInfoField :: String -&gt; Maybe (InstalledPackageInfo -&gt; String)
</span><a href="Distribution.InstalledPackageInfo.html#showInstalledPackageInfoField"><span class="hs-identifier hs-var hs-var">showInstalledPackageInfoField</span></a></span></span><span> </span><span id="local-6989586621679705609"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679705609"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-134"></span><span>    </span><span class="annot"><span class="annottext">((InstalledPackageInfo -&gt; Doc) -&gt; InstalledPackageInfo -&gt; String)
-&gt; Maybe (InstalledPackageInfo -&gt; Doc)
-&gt; Maybe (InstalledPackageInfo -&gt; String)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679705608"><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; Doc
</span><a href="#local-6989586621679705608"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; String
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#render"><span class="hs-identifier hs-var">Disp.render</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc -&gt; String)
-&gt; (InstalledPackageInfo -&gt; Doc) -&gt; InstalledPackageInfo -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc -&gt; Doc
</span><a href="Distribution.InstalledPackageInfo.html#ppField"><span class="hs-identifier hs-var">ppField</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679705609"><span class="hs-identifier hs-var">fn</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc -&gt; Doc)
-&gt; (InstalledPackageInfo -&gt; Doc) -&gt; InstalledPackageInfo -&gt; Doc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledPackageInfo -&gt; Doc
</span><a href="#local-6989586621679705608"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Maybe (InstalledPackageInfo -&gt; Doc)
 -&gt; Maybe (InstalledPackageInfo -&gt; String))
-&gt; Maybe (InstalledPackageInfo -&gt; Doc)
-&gt; Maybe (InstalledPackageInfo -&gt; String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FieldDescrs InstalledPackageInfo InstalledPackageInfo
-&gt; ByteString -&gt; Maybe (InstalledPackageInfo -&gt; Doc)
forall s a. FieldDescrs s a -&gt; ByteString -&gt; Maybe (s -&gt; Doc)
</span><a href="Distribution.FieldGrammar.FieldDescrs.html#fieldDescrPretty"><span class="hs-identifier hs-var">fieldDescrPretty</span></a></span><span> </span><span class="annot"><span class="annottext">FieldDescrs InstalledPackageInfo InstalledPackageInfo
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g InstalledPackageInfo),
 Applicative (g Basic), c (Identity AbiHash),
 c (Identity LibraryVisibility), c (Identity PackageName),
 c (Identity UnitId), c (Identity UnqualComponentName),
 c (List FSep (Identity AbiDependency) AbiDependency),
 c (List FSep (Identity UnitId) UnitId),
 c (List FSep (MQuoted ModuleName) ModuleName),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (MQuoted MungedPackageName), c (MQuoted Version),
 c CompatPackageKey, c ExposedModules, c InstWith,
 c SpecLicenseLenient) =&gt;
g InstalledPackageInfo InstalledPackageInfo
</span><a href="Distribution.Types.InstalledPackageInfo.FieldGrammar.html#ipiFieldGrammar"><span class="hs-identifier hs-var">ipiFieldGrammar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ByteString
</span><a href="Distribution.Utils.Generic.html#toUTF8BS"><span class="hs-identifier hs-var">toUTF8BS</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679705609"><span class="hs-identifier hs-var">fn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#showSimpleInstalledPackageInfoField"><span class="hs-identifier hs-type">showSimpleInstalledPackageInfoField</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.InstalledPackageInfo.html#InstalledPackageInfo"><span class="hs-identifier hs-type">InstalledPackageInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span id="showSimpleInstalledPackageInfoField"><span class="annot"><span class="annottext">showSimpleInstalledPackageInfoField :: String -&gt; Maybe (InstalledPackageInfo -&gt; String)
</span><a href="Distribution.InstalledPackageInfo.html#showSimpleInstalledPackageInfoField"><span class="hs-identifier hs-var hs-var">showSimpleInstalledPackageInfoField</span></a></span></span><span> </span><span id="local-6989586621679705604"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679705604"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-138"></span><span>    </span><span class="annot"><span class="annottext">((InstalledPackageInfo -&gt; Doc) -&gt; InstalledPackageInfo -&gt; String)
-&gt; Maybe (InstalledPackageInfo -&gt; Doc)
-&gt; Maybe (InstalledPackageInfo -&gt; String)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Doc -&gt; String
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#renderStyle"><span class="hs-identifier hs-var">Disp.renderStyle</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="#local-6989586621679705602"><span class="hs-identifier hs-var">myStyle</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc -&gt; String)
-&gt; (InstalledPackageInfo -&gt; Doc) -&gt; InstalledPackageInfo -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Maybe (InstalledPackageInfo -&gt; Doc)
 -&gt; Maybe (InstalledPackageInfo -&gt; String))
-&gt; Maybe (InstalledPackageInfo -&gt; Doc)
-&gt; Maybe (InstalledPackageInfo -&gt; String)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FieldDescrs InstalledPackageInfo InstalledPackageInfo
-&gt; ByteString -&gt; Maybe (InstalledPackageInfo -&gt; Doc)
forall s a. FieldDescrs s a -&gt; ByteString -&gt; Maybe (s -&gt; Doc)
</span><a href="Distribution.FieldGrammar.FieldDescrs.html#fieldDescrPretty"><span class="hs-identifier hs-var">fieldDescrPretty</span></a></span><span> </span><span class="annot"><span class="annottext">FieldDescrs InstalledPackageInfo InstalledPackageInfo
forall (c :: * -&gt; Constraint) (g :: * -&gt; * -&gt; *).
(FieldGrammar c g, Applicative (g InstalledPackageInfo),
 Applicative (g Basic), c (Identity AbiHash),
 c (Identity LibraryVisibility), c (Identity PackageName),
 c (Identity UnitId), c (Identity UnqualComponentName),
 c (List FSep (Identity AbiDependency) AbiDependency),
 c (List FSep (Identity UnitId) UnitId),
 c (List FSep (MQuoted ModuleName) ModuleName),
 c (List FSep FilePathNT String), c (List FSep Token String),
 c (MQuoted MungedPackageName), c (MQuoted Version),
 c CompatPackageKey, c ExposedModules, c InstWith,
 c SpecLicenseLenient) =&gt;
g InstalledPackageInfo InstalledPackageInfo
</span><a href="Distribution.Types.InstalledPackageInfo.FieldGrammar.html#ipiFieldGrammar"><span class="hs-identifier hs-var">ipiFieldGrammar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ByteString
</span><a href="Distribution.Utils.Generic.html#toUTF8BS"><span class="hs-identifier hs-var">toUTF8BS</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679705604"><span class="hs-identifier hs-var">fn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-140"></span><span>    </span><span id="local-6989586621679705602"><span class="annot"><span class="annottext">myStyle :: Style
</span><a href="#local-6989586621679705602"><span class="hs-identifier hs-var hs-var">myStyle</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="../../pretty/src/Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">Disp.style</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mode :: Mode
</span><a href="../../pretty/src/Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var">Disp.mode</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode
</span><a href="../../pretty/src/Text.PrettyPrint.Annotated.HughesPJ.html#LeftMode"><span class="hs-identifier hs-var">Disp.LeftMode</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span class="annot"><a href="Distribution.InstalledPackageInfo.html#ppField"><span class="hs-identifier hs-type">ppField</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Disp.Doc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Disp.Doc</span></a></span><span>
</span><span id="line-143"></span><span id="ppField"><span class="annot"><span class="annottext">ppField :: String -&gt; Doc -&gt; Doc
</span><a href="Distribution.InstalledPackageInfo.html#ppField"><span class="hs-identifier hs-var hs-var">ppField</span></a></span></span><span> </span><span id="local-6989586621679705598"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679705598"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621679705597"><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679705597"><span class="hs-identifier hs-var">fielddoc</span></a></span></span><span>
</span><span id="line-144"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Bool
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#isEmpty"><span class="hs-identifier hs-var">Disp.isEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679705597"><span class="hs-identifier hs-var">fielddoc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-145"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var">Disp.text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679705598"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="Distribution.Compat.Prelude.html#%3C%3C%3E%3E"><span class="hs-operator hs-var">&lt;&lt;&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#colon"><span class="hs-identifier hs-var">Disp.colon</span></a></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-var">Disp.&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc
</span><a href="#local-6989586621679705597"><span class="hs-identifier hs-var">fielddoc</span></a></span><span>
</span><span id="line-146"></span></pre></body></html>